var assert = require('assert');
var should = require('should');
var util = require('util');
var _ = require('lodash');
var expeditionModel = require('../../app/models/expeditionModel');
var config = require('../config');
var atkData = require('../../app/libs/war/atkData.js');

suite('测试expeditionModel', function () {
    var expedition_model;
    var role_id = 10000;
    setup(function (done) {
        expeditionModel.getByRoleId(role_id, function (err, model) {
            assert.equal(err == null, true);
            expedition_model = model;
            done();
        });
    });

    suite('保存战斗信息', function () {
        test('从竞技场取出战斗信息', function (done) {
            atkData.getDataForArena(role_id, 1, function (err, war_info) {
                console.log('war_info:', war_info);
                // console.log('war_info.soldier_list[0]:', war_info.soldier_list[0]);
                war_info.role_id = role_id;
                // expedition_model.rival_list.push(war_info);
                // expedition_model.save(done);
                done();
            });
        });
    });

    suite('刷新远征商店', function () {
        test('刷新远征商店', function (done) {
            expedition_model.refreshShop();
            // console.log('shop_list:', expedition_model.expedition_shop);
            done();
        });
    });
});
